package com.neutech.base;
import java.io.InputStream;
import javazoom.jl.player.advanced.AdvancedPlayer;
public class Music implements Runnable {
	private String mp3Url;
	private boolean isLoop;
	public Music(String mp3Url, boolean isLoop) {
		super();
		this.mp3Url = mp3Url;
		this.isLoop = isLoop;
	}
	public void run() {
		do {
			InputStream mp3 = Music.class.getClassLoader()
					.getResourceAsStream("com/neutech/music/" + mp3Url);
			try {
				AdvancedPlayer adv = new AdvancedPlayer(mp3);
				adv.play();
			} catch (Exception e) {
				e.printStackTrace();
			}
		} while (isLoop);
	}
}